/* 
 * File:   ScalarDataset.cpp
 * Author: cjjonker
 *
 * Created on 20 december 2012, 18:17
 */

#include "ScalarDataset.h"
#include <limits>

using namespace std;

ScalarDataset::ScalarDataset()
{ 
}

ScalarDataset::ScalarDataset(double* dat, int dim)
{
    d_data = dat;
    d_dim = dim;
}

double ScalarDataset::getMin() 
{
    double retMin = numeric_limits<double>::max();
    for (int idx = 0; idx != d_dim * d_dim; ++idx)
        retMin = min(retMin, this->getData(idx));
    return retMin;
}

double ScalarDataset::getMax()
{
    double retMax = numeric_limits<double>::min();
    for (int idx = 0; idx != d_dim * d_dim; ++idx)
        retMax = max(retMax, this->getData(idx));
    return retMax;
}

